<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>补偿业务-案件信息维护</title>
    <link rel="stylesheet" href="/layui/css/layui.css">
    <link rel="stylesheet" href="/css/custom.form.css">
</head>
<body>
<div class="panel panel-default operation" hidden>
    <div class="panel-heading title"></div>
    <div class="layui-card-body">
        <form class="layui-form " action="" lay-filter="info" style="width: 100%;margin-top: 10px">
            <input id="jcajxxuuid" name="jcajxxuuid" hidden/>
            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label">是否申请公安联合办案</label>
                    <div class="layui-input-block">
                        <select id="isSqgalhba">
                            <option value=''>请选择</option>
                            <option value='是'>是</option>
                            <option value='否'>否</option>
                        </select>
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">是否移送公安机关</label>
                    <div class="layui-input-block">
                        <select id="isYsgajg">
                            <option value=''>请选择</option>
                            <option value='是'>是</option>
                            <option value='否'>否</option>
                        </select>
                    </div>
                </div>

                <div class="layui-inline">
                    <label class="layui-form-label">是否一案双查</label>
                    <div class="layui-input-block">
                        <select id="isYasc">
                            <option value=''>请选择</option>
                            <option value='是'>是</option>
                            <option value='否'>否</option>
                        </select>
                    </div>
                </div>

                <div class="layui-inline">
                    <label class="layui-form-label">是否大案要案</label>
                    <div class="layui-input-block">
                        <select id="isDya">
                            <option value=''>请选择</option>
                            <option value='是'>是</option>
                            <option value='否'>否</option>
                        </select>
                    </div>
                </div>

                <div class="layui-inline">
                    <label class="layui-form-label">是否是黑名单</label>
                    <div class="layui-input-block">
                        <select id="isHmd">
                            <option value=''>请选择</option>
                            <option value='是'>是</option>
                            <option value='否'>否</option>
                        </select>
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">强制措施</label>
                <div class="layui-input-block">
                    <input id="qzcs" type="qzcs" name="qzcs" placeholder="请输入强制措施" autocomplete="off"
                           class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">案件定性</label>
                <div class="layui-input-block">
                    <select id="ajdx">
                        <option value='1'>虚开</option>
                        <option value='2'>团伙虚开骗税</option>
                        <option value='3'>偷税</option>
                        <option value='4'>其他问题</option>
                        <option value='5'>无问题案件</option>
                    </select>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">案件疑点信息</label>
                <div class="layui-input-block">
                    <input id="ajdyxx" type="ajdyxx" name="ajdyxx" placeholder="请输入案件疑点信息" autocomplete="off"
                           class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">超过追征收期应缴未缴税款金额</label>
                <div class="layui-input-block">
                    <input id="cgzzqyjwjskje" type="cgzzqyjwjskje" name="cgzzqyjwjskje" placeholder="请输入超过追征收期应缴未缴税款金额"
                           autocomplete="off" class="layui-input">
                </div>
            </div>


            <!--    以下为新增-->
            <div class="layui-form-item">
                <label class="layui-form-label">已查实但因企业亏损仅涉及调账</label>
                <div class="layui-input-block">
                    <input id="ycsdyqyksjsjtz" type="ycsdyqyksjsjtz" name="ycsdyqyksjsjtz"
                           placeholder="请输入已查实但因企业亏损仅涉及调账" autocomplete="off" class="layui-input">
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">案件查处时限积分-其他</label>
                <div class="layui-input-block">
                    <input id="ajccsxjfother" type="ajccsxjfother" name="ajccsxjfother" placeholder="请输入案件查处时限积分-其他"
                           autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label"> 案件定性积分-送市局大审时间</label>
                    <div class="layui-input-inline">
                        <input type="text" name="ssjdssj" id="ssjdssj" lay-verify="ssjdssj" placeholder="送市局大审时间"
                               autocomplete="off" class="layui-input">
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">其他积分</label>
                <div class="layui-input-block">
                    <input id="qtjf" type="qtjf" name="qtjf" placeholder="请输入其他积分" autocomplete="off"
                           class="layui-input">
                </div>
            </div>
            <fieldset class="layui-elem-field layui-field-title" style="margin-top: 10px;">
                <legend>成果运用积分</legend>
            </fieldset>
            <div class="layui-form-item">
                <label class="layui-form-label">推介积分</label>
                <div class="layui-input-block">
                    <input id="ajcccgjyzfxctjjf" type="ajcccgjyzfxctjjf" name="ajcccgjyzfxctjjf"
                           placeholder="请输入案件查处成果和经验做法获得省部级以上表彰或者省部级以上媒体宣传推介积分" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">典型案例的经验做法积分</label>
                <div class="layui-input-block">
                    <input id="dxaldjyzfjf" type="dxaldjyzfjf" name="dxaldjyzfjf" placeholder="请输入典型案例的经验做法积分"
                           autocomplete="off" class="layui-input">
                </div>
            </div>


            <fieldset class="layui-elem-field layui-field-title" style="margin-top: 10px;">
                <legend>科室负责人积分</legend>
            </fieldset>
            <div class="layui-form-item">
                <label class="layui-form-label">党建积分-深入学习贯彻党的二十大精神</label>
                <div class="layui-input-block">
                    <input id="djjfsrxxgcddesdjs" type="djjfsrxxgcddesdjs" name="djjfsrxxgcddesdjs"
                           placeholder="请输入党建积分-深入学习贯彻党的二十大精神，认证落实中央部署要求，扎实开展主题教育" autocomplete="off"
                           class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">党建积分-参加基层组织党建品牌选树工作</label>
                <div class="layui-input-block">
                    <input id="djjfcjjczzdjppxsgz" type="djjfcjjczzdjppxsgz" name="djjfcjjczzdjppxsgz"
                           placeholder="请输入党建积分-参加基层组织党建品牌选树工作" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">纪检积分</label>
                <div class="layui-input-block">
                    <input id="jjjf"  type="jjjf" name="jjjf" placeholder="请输入纪检积分"
                           autocomplete="off" class="layui-input">
                </div>
            </div>
            <!--    新增-->
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button type="submit" class="layui-btn" lay-submit="" lay-filter="submit">更新</button>
                    <button class="layui-btn layui-btn-primary" id="btn_cancel">返回</button>
                </div>
            </div>
        </form>
    </div>
</div>

<div class="table_div">
    <div id="searchParam">
        <div class="layui-form-item">
            <div class="layui-input-inline">
                <input type="text" id="jcajbh" class="layui-input"  autocomplete="off"
                       placeholder="请输入案件编号">
            </div>

            <div class="layui-input-inline">
                <button class="layui-btn" onclick="search()" id="search">查询</button>
            </div>
        </div>

    </div>
    <table class="layui-table" id="showTable" lay-filter="showTable"></table>
</div>
<script type="text/html" id="toolbar">
</script>
<script type="text/html" id="tool">
    <a class="layui-btn layui-btn-xs" lay-event="edit">更新</a>
</script>

</body>
</html>
<script src="/layui/layui.all.js"></script>
<script src="/js/core.util.js"></script>
<script>
    //获取token
    let token = CoreUtil.getData("access_token");
    //地址栏转义token中的#号
    let tokenQuery = token.replace("#", "%23");
    let tableIns1;
    let table = layui.table;
    let form = layui.form;
    let layer = layui.layer;
    let $ = jQuery = layui.jquery;
    let laydate = layui.laydate;
    let ssjdssj = "";
    layui.use(['table', 'layer', 'laydate'], function () {
        laydate.render({
            elem: '#ssjdssj',
            trigger: 'click'
            , done: function (value, date, endDate) {
                ssjdssj = value;
                console.log("ssjdssj=" + ssjdssj);
            }

        });
        //加载table
        tableIns1 = table.render({
            elem: '#showTable'
            , contentType: 'application/json'
            , headers: {"authorization": token}
            , page: true //开启分页
            , url: '/compensate/list1' //数据接口
            , method: 'POST'
            , parseData: function (res) { //将原始数据解析成 table 组件所规定的数据
                return {
                    "code": res.code, //解析接口状态
                    "msg": res.msg, //解析提示文本
                    "count": CoreUtil.isEmpty(res.data) ? 0 : res.data.total, //解析数据长度
                    "data": CoreUtil.isEmpty(res.data) ? null : res.data.records //解析数据列表
                }
            }
            , cols: [
                [
                    {type: 'checkbox', fixed: 'left'},
                    {field: 'jcajxxuuid', title: '稽查案件信息编号', sort: true, hide: true},
                    {width: 180, field: 'jcajbh', title: '稽查案件编号', sort: true},
                    {width: 280, field: 'ajmc', title: '案件名称', sort: true},
                    {width: 180, field: 'nsrmc', title: '纳税人名称', sort: true},
                    {width: 180, field: 'nsrsbh', title: '纳税人识别号', sort: true},
                    {width: 260, field: 'ajdyxx', title: '案件疑点信息', sort: true},
                    {width: 230, field: 'isSqgalhba', title: '是否申请公安联合办案', sort: true},
                    {width: 140, field: 'isDya', title: '是否大要案', sort: true},
                    {width: 140, field: 'isHmd', title: '是否黑名单', sort: true},
                    {width: 170, field: 'isYasc', title: '是否一案双查', sort: true},
                    {width: 170, field: 'isYsgajg', title: '是否移送公安机关', sort: true},
                    {width: 110, field: 'qzcs', title: '强制措施', sort: true},
                    {width: 250, field: 'cgzzqyjwjskje', title: '超过追征收期应缴未缴税款金额', sort: true},
                    {width: 100, field: 'ajdx', title: '案件定性', sort: true},

                    {width: 100, field: 'ycsdyqyksjsjtz', title: '已查实但因企业亏损仅涉及调账', sort: true},
                    {width: 100, field: 'ajccsxjfother', title: '案件查处时限积分-其他', sort: true},
                    {width: 100, field: 'ssjdssj', title: '案件定性积分-送市局大审时间', sort: true},
                    {width: 100, field: 'ajcccgjyzfxctjjf', title: '推介积分', sort: true},
                    {width: 100, field: 'dxaldjyzfjf', title: '典型案例的经验做法积分', sort: true},
                    {width: 100, field: 'djjfsrxxgcddesdjs', title: '党建积分-深入学习贯彻党的二十大精神', sort: true},
                    {width: 100, field: 'djjfcjjczzdjppxsgz', title: '党建积分-参加基层组织党建品牌选树工作', sort: true},
                    {width: 100, field: 'jjjf', title: '纪检积分', sort: true},
                    {width: 100, field: 'qtjf', title: '其他积分', sort: true},

                    {width: 180, field: 'updateTime', title: '更新时间', sort: true},
                    {width: 100, field: 'updateId', title: '更新人', sort: true},
                    {width: 80, toolbar: "#tool", title: '操作', fixed: 'right'}
                ]
            ]
            , toolbar: '#toolbar'
        });


        //表头工具
        table.on('toolbar(showTable)', function (obj) {
            switch (obj.event) {
                case 'batchDeleted':
                    var checkStatus = table.checkStatus(obj.config.id);
                    var data = checkStatus.data;
                    if (data.length == 0) {
                        layer.msg("请选择要批量删除的列");
                    } else {
                        var ids = [];
                        $(data).each(function (index, item) {
                            ids.push(item.id);
                        });
                        tipDialog(ids);
                    }
                    break;
                case 'add':
                    $(".table_div").hide();
                    $(".operation").show();
                    $(".title").html("新增");
                    $(".operation input[name=jcajxxuuid]").val("");
                    $(".operation input[name=jcajbh]").val("");
                    $(".operation input[name=ajdyxx]").val("");
                    $(".operation input[name=isSqgalhba]").val("");
                    $(".operation input[name=isDya]").val("");
                    $(".operation input[name=isHmd]").val("");
                    $(".operation input[name=isYasc]").val("");
                    $(".operation input[name=isYsgajg]").val("");
                    $(".operation input[name=qzcs]").val("");
                    $(".operation input[name=cgzzqyjwjskje]").val("");
                    $(".operation input[name=ajdx]").val("");
                    $(".operation input[name=field11]").val("");
                    $(".operation input[name=field12]").val("");
                    $(".operation input[name=field13]").val("");
                    $(".operation input[name=field14]").val("");
                    $(".operation input[name=field15]").val("");
                    $(".operation input[name=field16]").val("");
                    $(".operation input[name=field17]").val("");
                    $(".operation input[name=field18]").val("");
                    $(".operation input[name=deleted]").val("");
                    $(".operation input[name=createTime]").val("");
                    $(".operation input[name=updateTime]").val("");
                    $(".operation input[name=createId]").val("");
                    $(".operation input[name=updateId]").val("");
                    break;
            }
            ;
        });
        //列操作
        table.on('tool(showTable)', function (obj) {
            var data = obj.data;
            switch (obj.event) {
                case 'del':
                    var ids = [];
                    ids.push(data.id);
                    tipDialog(ids);
                    break;
                case 'edit':
                    $(".table_div").hide();
                    $(".operation").show();
                    $(".title").html("编辑");
                    $(".operation input[name=jcajxxuuid]").val(data.jcajxxuuid);
                    $(".operation input[name=jcajbh]").val(data.jcajbh);
                    $(".operation input[name=ajdyxx]").val(data.ajdyxx);
                    $(".operation input[name=isSqgalhba]").val(data.isSqgalhba);
                    $(".operation input[name=isDya]").val(data.isDya);
                    $(".operation input[name=isHmd]").val(data.isHmd);
                    $(".operation input[name=isYasc]").val(data.isYasc);
                    $(".operation input[name=isYsgajg]").val(data.isYsgajg);
                    $(".operation input[name=qzcs]").val(data.qzcs);
                    $(".operation input[name=cgzzqyjwjskje]").val(data.cgzzqyjwjskje);
                    $(".operation input[name=ajdx]").val(data.ajdx);
                    $(".operation input[name=field11]").val(data.field11);
                    $(".operation input[name=field12]").val(data.field12);
                    $(".operation input[name=field13]").val(data.field13);
                    $(".operation input[name=field14]").val(data.field14);
                    $(".operation input[name=field15]").val(data.field15);
                    $(".operation input[name=field16]").val(data.field16);
                    $(".operation input[name=field17]").val(data.field17);
                    $(".operation input[name=field18]").val(data.field18);
                    $(".operation input[name=deleted]").val(data.deleted);
                    $(".operation input[name=createTime]").val(data.createTime);
                    $(".operation input[name=updateTime]").val(data.updateTime);
                    $(".operation input[name=createId]").val(data.createId);
                    $(".operation input[name=updateId]").val(data.updateId);


                    $(".operation input[name=ycsdyqyksjsjtz]").val(data.ycsdyqyksjsjtz);
                    $(".operation input[name=ajccsxjfother]").val(data.ajccsxjfother);
                    $(".operation input[name=ssjdssj]").val(data.ssjdssj);
                    $(".operation input[name=ajcccgjyzfxctjjf]").val(data.ajcccgjyzfxctjjf);
                    $(".operation input[name=dxaldjyzfjf]").val(data.dxaldjyzfjf);
                    $(".operation input[name=djjfsrxxgcddesdjs]").val(data.djjfsrxxgcddesdjs);
                    $(".operation input[name=djjfcjjczzdjppxsgz]").val(data.djjfcjjczzdjppxsgz);
                    $(".operation input[name=jjjf]").val(data.jjjf);
                    $(".operation input[name=qtjf]").val(data.qtjf);
                    break;
            }
        });
        //导出
        $('#export').on('click', function () {
            //原先分页limit
            var exportParams = {
                limit: 10000,
                key: $("#key").val()
            };
            CoreUtil.sendPost("/workflowCompensate/listByPage", exportParams, function (res) {
                //初始化渲染数据
                if (res.data != null && res.data.records != null) {
                    table.exportFile(tableIns1.config.id, res.data.records, 'xls');
                }
            });
        });

        //删除
        var tipDialog = function (ids) {
            layer.open({
                content: "确定要删除么?",
                yes: function (index, layero) {
                    layer.close(index); //如果设定了yes回调，需进行手工关闭
                    CoreUtil.sendDelete("/workflowCompensate/delete", ids, function (res) {
                        layer.msg(res.msg, {time: 1000}, function () {
                            search();
                        });
                    });
                }
            });
        };

        //返回
        $("#btn_cancel").click(function () {
            $(".table_div").show();
            $(".operation").hide();
            return false;
        });

        //监听保存
        form.on('submit(submit)', function (data) {

            let map = {
                jcajxxuuid: $("#jcajxxuuid").val(),
                ajdyxx: $("#ajdyxx").val(),
                isSqgalhba: $("#isSqgalhba").val(),
                isDya: $("#isDya").val(),
                isHmd: $("#isHmd").val(),
                isYasc: $("#isYasc").val(),
                isYsgajg: $("#isYsgajg").val(),
                qzcs: $("#qzcs").val(),
                cgzzqyjwjskje: $("#cgzzqyjwjskje").val(),
                ajdx: $("#ajdx").val(),
                ycsdyqyksjsjtz: $("#ycsdyqyksjsjtz").val(),
                ajccsxjfother: $("#ajccsxjfother").val(),
                ssjdssj: ssjdssj,
                qtjf: $("#qtjf").val(),
                ajcccgjyzfxctjjf: $("#ajcccgjyzfxctjjf").val(),
                dxaldjyzfjf: $("#dxaldjyzfjf").val(),
                djjfsrxxgcddesdjs: $("#djjfsrxxgcddesdjs").val(),
                djjfcjjczzdjppxsgz: $("#djjfcjjczzdjppxsgz").val(),
                jjjf: $("#jjjf").val()
            }


            CoreUtil.sendPost("/compensate/update1", map, function (res) {
                $(".table_div").show();
                $(".operation").hide();
                search();
            });


            return false;
        });
    });

    //执行查询
    function search() {
        //这里以搜索为例
        tableIns1.reload({
            where: { //设定异步数据接口的额外参数，任意设
                jcajbh: $("#jcajbh").val()
            }
            , page: {
                curr: 1 //重新从第 1 页开始
            }
        });
    };
</script>